{include file='admin/header.html'}

<link rel="stylesheet" href="{res file='res/kindeditor/themes/default/default.css'}">
<link rel="stylesheet" href="{res file='res/kindeditor/plugins/code/prettify.css'}">
<script charset="utf-8" src="{res file='res/kindeditor/kindeditor-all-min.js'}"></script>
{if in_array($lang, ['ar', 'en', 'ko', 'ru', 'zh-CN', 'zh-TW'])}
<script charset="utf-8" src="{$site_url}/static/res/kindeditor/lang/{$lang}.js"></script>
{else}
<script charset="utf-8" src="{res file='res/kindeditor/lang/en.js'}"></script>
{/if}
<script charset="utf-8" src="{res file='res/kindeditor/plugins/code/prettify.js'}"></script>
<script>
    KindEditor.ready(function (K) {
        window.editor1 = K.create('textarea[name="content"]', {
            cssPath: '{$lang}' == 'mni-Mtei' ? ["{res file='res/kindeditor/plugins/code/prettify.css'}", "{res file='css/meetei-mayek.css'}"] : "{res file='res/kindeditor/plugins/code/prettify.css'}",
            uploadJson: "{$site_url}/{$lang}/admin/media/upload.html",
            fileManagerJson: "{res file='res/kindeditor/php/file_manager_json.php'}",
            allowFileManager: true,
        });
        prettyPrint();
    });
</script>

<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.page_title}</label>
        <div class="layui-input-block">
            <input type="text" name="title" value="" required lay-verify="required" placeholder="{$tran.input_page_title}"
                autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.parent_page}</label>
        <div class="layui-input-inline">
            <select name="pid" lay-verify="required">
                <option value="">{$tran.choose}</option>
                <option value="0" {if $pid==0} selected{/if}>{$tran.top_page}</option>
                {foreach from="$page" item="_page"}
                <option value="{$_page.id}" {if $pid==$_page.id} selected{/if}>{$_page.tree_title}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.slug}</label>
        <div class="layui-input-inline">
            <input type="text" name="slug" value="" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-word-aux">
            <button type="button" class="layui-btn layui-btn-primary translate-slug">{$tran.translate}</button>
            <i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop layui-hide loading"></i>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">{$tran.content}</label>
        <div class="layui-input-block">
            <textarea name="content" placeholder="{$tran.input_content}" class="layui-textarea"
                style="width:100%;height:500px;visibility:hidden;"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">{$tran.description}</label>
        <div class="layui-input-block">
            <textarea name="description" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.cover}</label>
        <div class="layui-input-inline">
            <input type="text" name="cover" value="" placeholder="" autocomplete="off" class="layui-input upload">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.sort}</label>
        <div class="layui-input-inline">
            <input type="number" name="sort" value="0" required lay-verify="required|number" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">SEO {$tran.title}</label>
        <div class="layui-input-block">
            <input type="text" name="seo_title" value="" placeholder="" autocomplete="off" class="layui-input">
            <div class="layui-form-mid layui-word-aux characters-count"></div>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">SEO {$tran.suggest}</label>
        <div class="layui-input-block">
            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary keywords-suggest baidu">baidu {$tran.keywords_suggest}</button>
            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary keywords-suggest google">Google {$tran.keywords_suggest}</button>
            <i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop layui-hide loading"></i>
        </div>
        <div class="layui-btn-container suggest-result" style="margin-top: 5px"></div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">SEO {$tran.discription}</label>
        <div class="layui-input-block">
            <textarea name="seo_description" placeholder="" class="layui-textarea"></textarea>
            <div class="layui-form-mid layui-word-aux characters-count"></div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.full_screen}</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_full" value="0">
            <input type="checkbox" name="is_full" value="1" lay-skin="switch" lay-text="ON|OFF">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.nav_menu}</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_nav" value="1">
            <input type="checkbox" name="is_nav" value="0" lay-skin="switch" checked lay-text="ON|OFF">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.status}</label>
        <div class="layui-input-block">
            <input type="hidden" name="status" value="1">
            <input type="checkbox" name="status" value="0" lay-skin="switch" checked lay-text="ON|OFF">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{$tran.save}</button>
            <button type="reset" class="layui-btn layui-btn-primary">{$tran.reset}</button>
        </div>
    </div>
</form>

{include file='admin/inc/form.html'}

{include file='admin/footer.html'}